package com.hzit.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 类名：
 * 作者：WF
 * 功能：
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Student implements Serializable {
	@TableId(type = IdType.AUTO)
	private Integer sid;
	private String sname;
	private String sex;
	private Integer age;
	private String addr;
	private Integer cid;

	// 逻辑删除配置
	@TableLogic  //(value = "0",delval = "1")
	private Integer deleted;

	// 自动填充
	@TableField(fill = FieldFill.INSERT)
	private LocalDateTime createTime;
	@TableField(fill = FieldFill.INSERT_UPDATE)
	private LocalDateTime updateTime;

	// 乐观锁
	@Version
	private Integer version;

	public Student(Integer sid, String sname, String sex, Integer age, String addr, Integer cid) {
		this.sid = sid;
		this.sname = sname;
		this.sex = sex;
		this.age = age;
		this.addr = addr;
		this.cid = cid;
	}

	public Student(String sname, String sex, Integer age, String addr, Integer cid) {
		this.sname = sname;
		this.sex = sex;
		this.age = age;
		this.addr = addr;
		this.cid = cid;
	}
}
